# todo: maybe I dont need logger
require 'logger'

### >>> the main class to maintain connection settings
module RongCloud
  module Config
    DEFAULT_RONG_HOST = "https://api.rongcloud.cn".freeze
    DEFAULT_TIMEOUT = 2
    DEFAULT_DEBUG_MDOE = true

    module ModuleMethods
      # rongcloud `appkey` `app secret`
      attr_accessor :app_key, :app_secret
      attr_writer :host, :timeout, :debug_mode

      # fetch the api host, the default host see above link
      def host
        @host || DEFAULT_RONG_HOST
      end

      def timeout
        @timeout || DEFAULT_TIMEOUT
      end

      def debug_mode
        @debug_mode || DEFAULT_DEBUG_MDOE
      end
      
      extend ModuleMethods
    end # end ModuleMethods 
  end # end Config
end
